<?php
/* SVN FILE: $Id: version_upgrade.php 229 2009-09-25 23:07:14Z supersmashbrothers $ */
/**
* ibMarket 2
* IP.Board 3.0
* IP.Board ibMarket upgrader
*
* @author $Author: supersmashbrothers $
* @copyright $Copyright$
* @version $Revision: 229 $
* @lastrevision $Date: 2009-09-25 23:07:14 +0000 (Fri, 25 Sep 2009) $
* @modifiedby $LastChangedBy: supersmashbrothers $
* @lastmodified $LastChangedDate: 2009-09-25 23:07:14 +0000 (Fri, 25 Sep 2009) $
* @filesource $URL: http://ipb-ibmarket.googlecode.com/svn/ibmarket2/trunk/admin/applications_addon/other/ibmarket/setup/versions/upg_10004/version_upgrade.php $
*/

if ( ! defined( 'IN_IPB' ) )
{
	print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
	exit();
}

class version_upgrade
{
	/**
	 * Custom HTML to show
	 *
	 * @access	private
	 * @var		string
	 */
	private $_output = '';
	
	/**
	* fetchs output
	* 
	* @access	public
	* @return	string
	*/
	public function fetchOutput()
	{
		return $this->_output;
	}
	
	/**
	 * Execute selected method
	 *
	 * @access	public
	 * @param	object		Registry object
	 * @return	void
	 */
	public function doExecute( ipsRegistry $registry ) 
	{
		/* Make object */
		$this->registry =  $registry;
		$this->DB       =  $this->registry->DB();
		$this->settings =& $this->registry->fetchSettings();
		$this->request  =& $this->registry->fetchRequest();
		$this->cache    =  $this->registry->cache();
		$this->caches   =& $this->registry->cache()->fetchCaches();
		
		$this->DB->build(array('select'=>'*','from'=>'market_items','where'=>"filename='/item_uploademotion.php'"));
		$q = $this->DB->execute();
		while($item = $this->DB->fetch($q))
		{
			$setting = unserialize($item['item_config']);
			$setting['max_size'] = 1500;
			$setting['clickable'] = 0;
			$this->DB->update('market_items',array(
													'item_config' => serialize($setting)
					),"item_id=".$item['item_id']);
		}
		
		return true;
	}
}
	
?>
